<cfimport taglib="/cacheManagement/util/" prefix="cache" />
<html>

	<head>
		
		<link type="text/css" href="/cacheManagement/examples/assets/style.css" rel="stylesheet" />
		<title>Cache Management Examples</title>
		
	</head>
	
	<body>
	

	<cfscript>
	cm = getCacheManager();
	
	startTime = getTickCount();
	
	if( not cm.exists( 'Computer', 'myComposite' ) ){
		
		message = "set a cache";
	
		c = getFactory().createComputer();
		
		cm.add( 'Computer', 'myComposite', c );
	
	}else{
	
		c = cm.get( 'Computer', 'myComposite' );
		
		message = "get a cache";
	
	}
	
	endTime = getTickCount();
	
	totalExecution = endTime - startTime;
	</cfscript>
	
	<div class="title">Basic examples</div>
	
	<p></p>
	
	<textarea cols="60" rows="5" class="code">
	cm = getCacheManager();
	
	startTime = getTickCount();
	
	if( not cm.exists( 'Computer', 'myComposite' ) ){
	
		c = getFactory().createComputer();
		
		cm.add( 'Computer', 'myComposite', c );
	
	}else{
	
		c = cm.get( 'Computer', 'myComposite' );
	
	}
	
	endTime = getTickCount();
	
	totalExecution = endTime - startTime;
	</textarea><br/>
	
	<br/>
	<p>Command: <cfoutput>#message#</cfoutput>.</p>
	<p>Total execution time: <cfoutput>#totalExecution#</cfoutput> ms</p>
	
	<a href="../../index.cfm">Back to home</a><br />
	
	<cache:monitor cacheManager="#cm#" />
	</body>

</html>